package com.lanou3g.ptp.achievement.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.lanou3g.ptp.achievement.mapper.LikeMapper;
import com.lanou3g.ptp.achievement.service.LikeService;
import com.lanou3g.ptp.entity.Like;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Date;
import java.util.List;

@Service
public class LikeServiceImpl implements LikeService {

    @Autowired
    private LikeMapper likeMapper;

    @Override
    public void insert(Like like) {
        like.setCreateTime(new Date());
        like.setUpdateTime(new Date());
        likeMapper.insert(like);
    }

    @Override
    public void delete(Long diaryId,Long id) {
        likeMapper.delete(diaryId,id);
    }

    @Override
    public Long find(Long id) {
        return likeMapper.find(id);
    }
}
